# nonlocal：在【内部函数】中，声明外层的局部变量
# global：在函数中，声明全局变量

foo = 100
bar = 200


def outer():
    foo = 123
    bar = 456
    print("outer: foo =", foo, ", bar =", bar)

    def inner():
        global bar
        nonlocal foo
        print("inner: foo =", foo, ", bar =", bar)

    inner()


outer()
